Build/Test Tools: Allow the reusable PHPUnit workflow to test another repository. - #12862
Open
lucatume wants to merge 5 commits into
Open
Build/Test Tools: Allow the reusable PHPUnit workflow to test another repository.#12862lucatume wants to merge 5 commits into
lucatume wants to merge 5 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
lucatume
marked this pull request as draft
August 5, 2026 15:04
lucatume
force-pushed
the
reusable-phpunit-tests-extended-support
branch
from
August 6, 2026 13:45
4a3955e to
5fdbb75
Compare
lucatume
force-pushed
the
reusable-phpunit-tests-extended-support
branch
from
August 26, 2026 09:07
5fdbb75 to
7512776
Compare
lucatume
marked this pull request as ready for review
August 26, 2026 09:07
lucatume
force-pushed
the
reusable-phpunit-tests-extended-support
branch
from
August 31, 2026 08:12
7512776 to
ec2e88b
Compare
… repository. A reusable workflow checks out the repository that calls it, so a caller that is not wordpress-develop cannot use this workflow and ends up maintaining a copy of it. Add optional `repository` and `ref` inputs so the checkout can point elsewhere, and an `overlay-artifact` input that unpacks a same-run artifact over the checkout, for callers whose test files are not part of the repository being tested. Derive the prepared Gutenberg artifact name from `ref` as well. Every branch in a run shares one artifact namespace, so a caller testing several branches needs one build per branch. The producer composes the same name from its own `ref`, so the name is never passed between them and `gutenberg-artifact` stays the boolean it became in [63162]. All inputs default to empty, so existing callers are unaffected: `repository` falls back to the calling repository, an empty `ref` is already checkout's own default and keeps the original `gutenberg-build` name, and the overlay step is skipped.
…ository. The producer checks out the commit that started the calling workflow run, so a caller preparing a build for a branch of another repository always got the wrong one. Add optional `repository` and `ref` inputs. Name the uploaded artifact after the ref it was built from. Every branch in a run shares one artifact namespace, so a caller preparing several builds would otherwise collide on a single name. The PHPUnit consumer composes the same name from its own `ref`, so the name is never passed between them. Retry the download as well. On branches whose download.js predates the in-script retry the blob is streamed straight into tar in a single attempt, so an interrupted stream fails the job outright. Both inputs default to the current behaviour, so existing callers are unaffected: an empty `ref` keeps the original `gutenberg-build` name.
lucatume
force-pushed
the
reusable-phpunit-tests-extended-support
branch
from
August 31, 2026 09:10
ec2e88b to
ea2e265
Compare
Both workflows compose the Gutenberg artifact name from `ref`, and upload-artifact rejects a name holding a slash or any of : < > | * ? or a double quote. A `refs/heads/trunk` or `feature/x` value fails the upload, after the download has already run. Workflow expressions have no string replacement, so the two sides cannot sanitise the value independently and still agree on a name. State the constraint on both inputs instead. `reusable-test-core-build-process` avoids the problem the other way, naming its ZIP after a pull request number or a SHA. Claude-Session: https://claude.ai/code/session_011piBrz5J1ZWLqwuCF2YYgG
The new `repository` input is only half a location. Without a `ref` the PHPUnit workflow checks out that repository's default branch, so a job labelled for one branch tests another and still reports green. The Gutenberg producer fails instead, but on a commit SHA that says nothing about the missing input. Fail both up front, before the checkout, rather than leaving the two workflows to diverge on how they mishandle the same gap. Claude-Session: https://claude.ai/code/session_011piBrz5J1ZWLqwuCF2YYgG
Three outer attempts around the three that download.js now makes itself is nine downloads of up to two minutes, well past the ten minutes the job is allowed. A persistently failing download had the job killed on the timeout instead of reporting why it gave up. Retry once, and raise the timeout to cover the two attempts that remain. Branches whose download.js predates the in-script retry still get the second try they were given this for. Claude-Session: https://claude.ai/code/session_011piBrz5J1ZWLqwuCF2YYgG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trac ticket: https://core.trac.wordpress.org/ticket/65964
A reusable workflow checks out the repository that calls it, so
reusable-phpunit-tests-v3.ymlcan only test a wordpress-develop checkout made by a wordpress-develop workflow run. A repository that wants to run this suite against a wordpress-develop checkout with its own test files layered in has no way to call it, and keeps a copy of the workflow instead. That copy then inherits none of the fixes that land here.Three optional inputs remove the need for one:
repositoryandreffor the checkout, andoverlay-artifact, which unpacks a same-run artifact over the checkout for callers whose test files aren't part of the repository being tested.What to check
All three inputs default to an empty string, so no existing caller changes behaviour:
repository: ${{ inputs.repository || github.repository }}falls back togithub.repository, which isactions/checkout's own default.ref: ''is alreadyactions/checkout's default.if: inputs.overlay-artifact != ''.phpunit-tests.yml,test-coverage.ymland every 5.9+ branch calling this workflow at@trunkpass none of them.The overlay is downloaded after the checkout and before the Gutenberg build, so a caller can't use it to swap out a prepared Gutenberg build. It reads through the same same-run artifact mechanism as
gutenberg-artifact, so it can only reach artifacts from the run that called the workflow.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: analysing the constraint and proposing the diff; I applied and reviewed the change.